FROM 192.168.1.248:5000/openjdk:8u191-jre-alpine as builder

# RUN mkdir -p /opt/apps/learn-api
WORKDIR application
COPY target/learn-blog-backend-0.0.1-SNAPSHOT.jar application.jar

RUN java -Djarmode=layertools -jar application.jar extract

# 二阶段
FROM 192.168.1.248:5000/openjdk:8u191-jre-alpine
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/spring-boot-loader/ ./
COPY --from=builder application/snapshot-dependencies/ ./
COPY --from=builder application/application/ ./

ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]